www.gusucode.com > 南充人开源PHP文章系统 v1.0 > 南充人开源PHP文章系统 v1.0\code\web\z_images\bhs.js
//保护色 function get_cookie(name_to_get) { var cookie_pair var cookie_name var cookie_value // Split all the cookies into an array var cookie_array = document.cookie.split("; ") // Run through the cookies for (counter = 0; counter < cookie_array.length; counter++) { // Split the cookie into a name/value pair cookie_pair = cookie_array[counter].split("=") cookie_name = cookie_pair[0] cookie_value = cookie_pair[1] // Compare the name with the name we want if (cookie_name == name_to_get) { // If this is the one, return the value return unescape(cookie_value) } } // If the cookie doesn't exist, return null return null } // Get the bgColor cookie var bg_color = get_cookie("bgColor_cookie") // Did the cookie exist? //if (bg_color) { // document.bgColor = bg_color //} function set_color(color_val) { // Get the currently selected color //var color_list = color_form.color_name //var selected_color = color_list.options[color_list.selectedIndex].value // Change the color of the background //opener.document["bgColor"] = color_val // Save it in a cookie set_cookie("bgColor_cookie", color_val, 365, "/") } function set_cookie(cookie_name, cookie_value, cookie_expire, cookie_path, cookie_domain, cookie_secure) { // Begin the cookie parameter string var cookie_string = cookie_name + "=" + cookie_value // Add the expiration date, if it was specified if (cookie_expire) { var expire_date = new Date() var ms_from_now = cookie_expire * 24 * 60 * 60 * 1000 expire_date.setTime(expire_date.getTime() + ms_from_now) var expire_string = expire_date.toGMTString() cookie_string += "; expires=" + expire_string } // Add the path, if it was specified if (cookie_path) { cookie_string += "; path=" + cookie_path } // Add the domain, if it was specified if (cookie_domain) { cookie_string += "; domain=" + cookie_domain } // Add the secure Boolean, if it's true if (cookie_secure) { cookie_string += "; true" } // Set the cookie document.cookie = cookie_string } document.write("<table border=\"0\" id=\"pcoloration\" cellspacing=\"0\">"); document.write("<tr>"); document.write("<td style=\"filter: glow(color=#000000,strength=1)\">"); document.write("<A "); document.write("onclick=\"ccolor.style.backgroundColor='FAF9DE';set_color('FAF9DE')\" "); document.write("href=\"javascript://\" title=\"杏仁黄\"><font style=\"font-size: 9pt\" color=\"#FAF9DE\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='FFF2E2';set_color('FFF2E2')\" "); document.write("href=\"javascript://\" title=\"秋叶褐\"><font style=\"font-size: 9pt\" color=\"#FFF2E2\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='FDE6E0';set_color('FDE6E0')\" "); document.write("href=\"javascript://\" title=\"胭脂红\"><font style=\"font-size: 9pt\" color=\"#FDE6E0\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='E3EDCD';set_color('E3EDCD')\" "); document.write("href=\"javascript://\" title=\"青草绿\"><font style=\"font-size: 9pt\" color=\"#E3EDCD\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='DCE2F1';set_color('DCE2F1')\" "); document.write("href=\"javascript://\" title=\"海天蓝\"><font style=\"font-size: 9pt\" color=\"#DCE2F1\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='E9EBFE';set_color('E9EBFE')\" "); document.write("href=\"javascript://\" title=\"葛巾紫\"><font style=\"font-size: 9pt\" color=\"#E9EBFE\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='EAEAEF';set_color('EAEAEF')\" "); document.write("href=\"javascript://\" title=\"极光灰\"><font style=\"font-size: 9pt\" color=\"#EAEAEF\">█</font></A> <A "); document.write("onclick=\"ccolor.style.backgroundColor='FFFFFF';set_color('FFFFFF')\" "); document.write("href=\"javascript://\" title=\"银河白\"><font style=\"font-size: 9pt\" color=\"#FFFFFF\">█</font></A>"); document.write("</td>"); document.write("</tr>"); document.write("</table>"); function copyToClipBoard() { var clipBoardContent=window.document.title; clipBoardContent+='\r\n' + window.document.location.href; window.clipboardData.setData("Text",clipBoardContent); alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友!\r\n\r\n内容如下:\r\n" + clipBoardContent); }